/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.persistencia.domain;

import java.io.Serializable;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author kenny
 */
@Entity
@Table(name = "dictado")
@NamedQueries({
    @NamedQuery(name = "Dictado.findAll", query = "SELECT d FROM Dictado d"),
    @NamedQuery(name = "Dictado.findByNDctId", query = "SELECT d FROM Dictado d WHERE d.nDctId = :nDctId"),
    @NamedQuery(name = "Dictado.findByVEstado", query = "SELECT d FROM Dictado d WHERE d.vEstado = :vEstado")})
public class Dictado implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "nDctId")
    private Integer nDctId;
    @Size(max = 1)
    @Column(name = "vEstado")
    private String vEstado;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "dictado")
    private List<Dictadoxsalon> dictadoxsalonList;
    @JoinColumn(name = "nGrpId", referencedColumnName = "nGrpId")
    @ManyToOne(optional = false)
    private Grupo nGrpId;
    @JoinColumn(name = "nClsId", referencedColumnName = "nClsId")
    @ManyToOne(optional = false)
    private Clase nClsId;

    public Dictado() {
    }

    public Dictado(Integer nDctId) {
        this.nDctId = nDctId;
    }

    public Integer getNDctId() {
        return nDctId;
    }

    public void setNDctId(Integer nDctId) {
        this.nDctId = nDctId;
    }

    public String getVEstado() {
        return vEstado;
    }

    public void setVEstado(String vEstado) {
        this.vEstado = vEstado;
    }

    public List<Dictadoxsalon> getDictadoxsalonList() {
        return dictadoxsalonList;
    }

    public void setDictadoxsalonList(List<Dictadoxsalon> dictadoxsalonList) {
        this.dictadoxsalonList = dictadoxsalonList;
    }

    public Grupo getNGrpId() {
        return nGrpId;
    }

    public void setNGrpId(Grupo nGrpId) {
        this.nGrpId = nGrpId;
    }

    public Clase getNClsId() {
        return nClsId;
    }

    public void setNClsId(Clase nClsId) {
        this.nClsId = nClsId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nDctId != null ? nDctId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Dictado)) {
            return false;
        }
        Dictado other = (Dictado) object;
        if ((this.nDctId == null && other.nDctId != null) || (this.nDctId != null && !this.nDctId.equals(other.nDctId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.persistencia.domain.Dictado[ nDctId=" + nDctId + " ]";
    }
    
}
